package com.smartscreen.schedulemanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartscreen.schedulemanage.entity.CalendarEvent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface CalendarEventMapper extends BaseMapper<CalendarEvent> {
    
    @Select("SELECT * FROM calendar_event " +
            "WHERE DATE(start_time) >= #{start} AND DATE(end_time) <= #{end} " +
            "ORDER BY start_time")
    List<CalendarEvent> getEventsByDateRange(@Param("start") LocalDate start, @Param("end") LocalDate end);
}